package com.example.myspringbootpj.service;

import com.example.myspringbootpj.entity.User;
import com.example.myspringbootpj.mapper.AdminMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SelectService {
    private AdminMapper adminMapper;
    @Autowired
    public SelectService(AdminMapper adminMapper) {
        this.adminMapper = adminMapper;
    }
    public List<User> SelectUUU(String selectId){
        List<User> users;
        switch (selectId) {
            case "1":
                users = adminMapper.getAllUsers();
                break;
            case "2":
                users = adminMapper.getBanUsers();
                break;
            case "3":
                users = adminMapper.getNotBanUsers();
                break;
            default:
                users = null;
        }
        return users;
    }
}
